package com.bawei.day14_zuoye.fragment;


import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import com.bawei.day14_zuoye.R;
import com.bawei.day14_zuoye.adapter.SongAdapter;
import com.bawei.day14_zuoye.bean.SongBean;
import com.bawei.day14_zuoye.utils.SongsUtils;

import java.util.List;

/**
 * A simple {@link Fragment} subclass.
 */
public class OneFragment extends Fragment {
    private ListView listView;
    private SongAdapter songAdapter;
    private List<SongBean> list;


    public OneFragment() {
        // Required empty public constructor
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_one, container, false);
        listView = view.findViewById(R.id.lv);
        list = SongsUtils.getSongs(getContext());
        songAdapter = new SongAdapter(getContext(),list);
        listView.setAdapter(songAdapter);
        return view;
    }

}
